package com.hbzhit.modules.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hbzhit.common.utils.MybatisCache;
import com.hbzhit.modules.sys.entity.SysMenuEntity;
import com.hbzhit.modules.sys.entity.SysUserEntity;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 系统用户
 *
 * @author Mark sunlightcs@gmail.com
 */
@Mapper
@Repository
@CacheNamespace(implementation = MybatisCache.class, eviction = MybatisCache.class)
public interface SysUserDao extends BaseMapper<SysUserEntity> {

	/**
	 * 查询用户的所有权限
	 */
	List<String> queryAllPerms(Long userId, String prop);

	/**
	 * 查询用户的所有菜单ID
	 */
	List<Long> queryAllMenuId(Long userId);

	/**
	 * 查询用户的所有菜单
	 */
	List<SysMenuEntity> queryAllMenu(Long userId, String prop);

	/**
	 * 根据用户名，查询系统用户
	 */
	SysUserEntity queryByUserName(String username);

}
